package cn.com.mayue.guava.basic;

import com.google.common.base.Optional;
import org.junit.Test;

/**
 * Created by mayue on 2017/2/25.
 * Optional 测试 使用测试
 */
public class OptionalTest {
    @Test
    public void test(){
//        Long value = 9L;
        Long value = null;
        Optional<Long> optional = Optional.fromNullable(value);
        System.out.println(optional.or(0L));
    }
}
